﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.anhry.app.safety.util.Util"%>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>企业列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath+Util.SKIN%>/css/right.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<%=basePath%>/js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/dbdialog/lhgdialog.min.js<%=Util.LHGDIALOG%>"></script>
	<script type="text/javascript" src="<%=path%>/js/selected.js"></script>
	<script type="text/javascript" src="<%=path%>/js/util.js"></script>
	<script type="text/javascript">
		function resetPwd(cid){
			var urls="<%=basePath%>/enterprise/corp_resetPwd.action?corpId="+cid;
			$.get(urls,function(data){
				if(data=="0"){
					alert("重置密码失败！");
				}else if(data=="1"){
					alert("重置密码成功！");
				}
			});
			return;
		}
		$(function(){
			initSelArray('cUnit:1','cDept:1','cMinType:2');
			var cCounty = '${cCounty}';
			var cUnit = '${cUnit}';
			var cDept = '${cDept}';
			if(null!=cCounty && cCounty!=""){
				changeCounty(cCounty);
			}
	   		if(cUnit!=null && cUnit!=""){
	   			changeUnit(cUnit);
	   			selected('cUnit',cUnit);	//加载选中项
	   		}
	   		if(cDept!=null && cDept!=""){
	   			selected('cDept',cDept);	//加载选中项
	   		}
	   		
	   		var cMaxType = '${cMaxType}';
			var cMinType = '${cMinType}';
			if(null!=cMaxType && cMaxType!=""){
				changeType(cMaxType);
			}
			if(cMinType!=null && cMinType!=""){
	   			selected('cMinType',cMinType);	//加载选中项
	   		}
	   		
		});
		
		function changeCounty(cid){
	   		var urls='<%=basePath%>/util/data_getDept.action?cUnit='+cid+"&cCounty=1";
	   		buildSelect(cid, 'cUnit',urls,'1');
	   	}
	   	function changeUnit(uid){
	   		var urls="<%=basePath%>/util/data_getDept.action?cUnit="+uid;
	   		buildSelect(uid, 'cDept',urls,'1');
	   	}
	   	function changeType(maxid){
	   		var urls="<%=basePath%>/util/data_getCorpType.action?cMaxType="+maxid;
	   		buildSelect(maxid, 'cMinType',urls,'2');
	   	}
	   	function reSearch(){
	   		window.location.href='<%=basePath%>/enterprise/two_list.action?search=1';
	   	}
	   	
   		function opdlg(cid){
			infoDialog('corpDele','关闭企业','540','300','<%=path%>/enterprise/corp_delete.action?corpId='+cid+'');
		}
		
		function update(id){
			document.form1.corpId.value=id;
			document.form1.submit();
		}
	</script>
  </head>
  
  <body>
	<div  class="body-box">
		<div class="map">
			<div class="map_con">
				您当前的位置：企业分类管理 &gt; 二级企业管理 &gt; 企业列表
			</div>
		</div>
		<div id="container">
			<fieldset class="serarch_set">
				<legend>
			  		<div class="search">查询条件</div>
			  	</legend>
			  	<form action="<%=basePath%>/enterprise/two_list.action?search=1" method="post" name="corpForm">
			   		<label style="width: 80px;">属地：</label> 
			   			<s:select list="sdList" name="cCounty" listKey="id" listValue="deptName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;" id="cCounty" onchange="changeCounty(this.value);"></s:select>
			   			<s:select list="#{}" name="cUnit" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cUnit" onchange="changeUnit(this.value);"></s:select>
			   			<s:select list="#{}" name="cDept" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cDept"></s:select>
			   		<label style="width: 80px;margin-left:43px;">行业部门：</label><s:select list="hyList" name="cHy" value="%{cHy}" listKey="id" listValue="deptName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
			   		<br/>
			   		<label style="width: 80px;">企业类型：</label> 
			   			<s:select list="typeList" name="cMaxType" listKey="id" listValue="typeName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;" id="cMaxType" onchange="changeType(this.value);"></s:select> 
			   			<s:select list="#{}" name="cMinType" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cMinType"></s:select>
			   		<label style="width: 73px;margin-left:207px;">是否小微企业：</label>
			   			<s:select list="#{1:'非小微企业',2:'小微企业'}" name="cZcType" listKey="key" listValue="value" value="%{cZcType}" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
			   		<br/>
			   		<label style="width: 80px;">隶属关系：</label> 
			     	<s:select list="#{'10':'中央','20':'省','40':'市、地区','50':'县','60':'街道、镇、乡','61':'街道','62':'镇','63':'乡','70':'居民、村民委员会','71':'居民委员会','72':'村民委员会','90':'其他'}" name="cLixu" value="%{cLixu}" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
			     	<br>
			     	<label style="width: 80px;">名称：</label><input type="text" name="keyWord" value="${keyWord }" size="50%">
			   		<input type="submit" value="搜 索" class="link_input" name="btnsx">
			   		<input type="button" value="重置搜索条件" class="link_input" name="btnsx" onclick="reSearch();">
			  	</form>
			</fieldset>
		  	<table border="0" cellpadding="0" cellspacing="0" class="mytable">
		   		<thead>
			    	<tr class="fixedHeaderTr">
			     		<th width="5%">序号</th>
			     		<th width="20%">企业名称</th>
			     		<th width="20%">属地</th>
			     		<th width="20%">企业类型</th>
			     		<th width="15%">行业部门</th>
			     		<th width="8%" title="是否小微企业，非小微企业使用标准自查，小微企业使用通用表自查">是否小微企业</th>
			     		<th width="12%">操作</th>
			    	</tr>
		   		</thead>
			   	<tbody>
			   		<s:if test="%{corpList.size>0}">
			   			<s:iterator value="corpList" id="obj" status="x">
				   			<tr>
					     		<td align="center">${x.index+1+(page.num-1)*page.size}</td>
					     		<td align="left"><a href="<%=basePath%>/enterprise/two_look.action?corpId=${obj.id }" target="_blank" title="${obj.corpName}">${obj.corpName }</a></td>
					     		<td align="left">${obj.countyName}-${obj.unitName }-${obj.deptName}</td>
					     		<td align="left">${obj.maxTypeName }-${obj.minTypeName }</td>
					     		<td align="left">${obj.deptMainName }</td>
					     		<td align="center">
					     			<s:if test="%{#obj.corpReportType==1}">非小微企业</s:if>
					     			<s:if test="%{#obj.corpReportType==2}">小微企业</s:if>
					     		</td>
					     		<td align="center">
						     		<sp:permission module="corptwo" permissionType="${UPDATE}">
						     			<a href="javascript:resetPwd('${obj.id}');" title="重置企业登录密码">重置密码</a>
						     			<a href="javascript:update('${obj.id }');">修改</a>
						     		</sp:permission>
						     		<sp:permission module="corptwo" permissionType="${DELETE}">
						     			<a href="javascript:opdlg('${obj.id }');">关闭</a>
						     		</sp:permission>
					     		</td>
					    	</tr>
			   			</s:iterator>
			    	</s:if>
			    	<s:else>
				    	<tr>
				     		<td align="center" colspan="7">暂无数据</td>
				    	</tr>
			    	</s:else>
			   	</tbody>
		  	</table>
		  	<div class="btn_page">
		  		<sp:permission module="corptwo" permissionType="${CREATE}"><input type="button" class="link_input" value="添加企业" onclick="window.location.href='<%=basePath %>/enterprise/two_add.action?${urls }&num=${page.num }&size=${page.size }'"/></sp:permission>
		  	</div>
		  	<div class="page">
				<jsp:include flush="true" page="../share/fenye.jsp">
				    <jsp:param name="url4page" value="/enterprise/two_list.action?${urls }" />
			    </jsp:include>	    	
		    </div>
	 	</div>
	</div>
	<form action="<%=basePath %>/enterprise/two_update.action" name="form1" method="post">
		<input type="hidden" name="corpId" value="">
		<input type="hidden" name="urls" value="${urls }">
		<input type="hidden" name="num" value="${page.num }">
		<input type="hidden" name="size" value="${page.size }">
	</form>
  </body>
  <s:if test="%{tip!=null}">
    	<script>
    		msgDialog('${tip}','succ.png');
    	</script>
    </s:if>
</html>
